Skip to content

Avoid Marshal.SizeOf in EventSource - #47521

Merged
stephentoub merged 4 commits into
dotnet:masterfrom
MichalStrehovsky:MichalStrehovsky-patch-1
Jan 29, 2021
Merged

Avoid Marshal.SizeOf in EventSource#47521
stephentoub merged 4 commits into
dotnet:masterfrom
MichalStrehovsky:MichalStrehovsky-patch-1

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

We're getting the marshalling size of an enum underlying type - there are not that many of those. I chose not to treat char and bool, but we could (the only other remaining options).

Calling into Marshal.SizeOf increases the risk that EventSource is going call itself recursively - see the comment at the beginning of the method.

This was originally introduced in dotnet/coreclr#19205.

We're getting the marshalling size of an enum underlying type - there are not that many of those. I chose not to treat `char` and `bool`, but we could (the only other remaining options).

Calling into `Marshal.SizeOf` increases the risk that `EventSource` is going call itself recursively - see the comment at the beginning of the method.

This was originally introduced in dotnet/coreclr#19205.

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stephentoub
stephentoub merged commit 01a36b5 into dotnet:master Jan 29, 2021
@MichalStrehovsky
MichalStrehovsky deleted the MichalStrehovsky-patch-1 branch January 29, 2021 14:43
@ghost ghost locked as resolved and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants